//SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
//SPDX-License-Identifier: GPL-3.0-only

export namespace board {
    export type CreateBoardNotice = {
        board_id: string;
    };

    export type UpdateBoardNotice = {
        board_id: string;
    };

    export type RemoveBoardNotice = {
        board_id: string;
    };

    export type JoinBoardNotice = {
        board_id: string;
        member_user_id: string;
    };

    export type LeaveBoardNotice = {
        board_id: string;
        member_user_id: string;
    };

    export type UpdateBoardMemberPermNotice = {
        board_id: string;
        member_user_id: string;
    };

    export type CreateDrawNotice = {
        board_id: string;
        draw_id: string;
    };

    export type UpdateDrawNotice = {
        board_id: string;
        draw_id: string;
    };

    export type RemoveDrawNotice = {
        board_id: string;
        draw_id: string;
    };

    export type CreateNodeNotice = {
        board_id: string;
        draw_id: string;
        node_id: string;
    };

    export type UpdateNodeNotice = {
        board_id: string;
        draw_id: string;
        node_id: string;
    };

    export type RemoveNodeNotice = {
        board_id: string;
        draw_id: string;
        node_id: string;
    };

    export type CreateEdgeNotice = {
        board_id: string;
        draw_id: string;
        from_node_id: string;
        from_handle: string;
        to_node_id: string;
        to_handle: string;
    };

    export type UpdateEdgeNotice = {
        board_id: string;
        draw_id: string;
        from_node_id: string;
        from_handle: string;
        to_node_id: string;
        to_handle: string;
    };

    export type RemoveEdgeNotice = {
        board_id: string;
        draw_id: string;
        from_node_id: string;
        from_handle: string;
        to_node_id: string;
        to_handle: string;
    };

    export type RemoveEdgeByHandleNotice = {
        board_id: string;
        draw_id: string;
        node_id: string;
        handle_list: string[];
    };

    export type UserMouseChangeNotice = {
        board_id: string;
        draw_id: string;
        member_user_id: string;
        x: number;
        y: number;
    };

    export type ExtDataConfigChangeNotice = {
        board_id: string;
    };

    export type NewChatMsgNotice = {
        board_id: string;
        draw_id: string;
        msg_id: string;
    };

    export type AllNotice = {
        CreateBoardNotice?: CreateBoardNotice;
        UpdateBoardNotice?: UpdateBoardNotice;
        RemoveBoardNotice?: RemoveBoardNotice;
        JoinBoardNotice?: JoinBoardNotice;
        LeaveBoardNotice?: LeaveBoardNotice;
        UpdateBoardMemberPermNotice?: UpdateBoardMemberPermNotice;
        CreateDrawNotice?: CreateDrawNotice;
        UpdateDrawNotice?: UpdateDrawNotice;
        RemoveDrawNotice?: RemoveDrawNotice;
        CreateNodeNotice?: CreateNodeNotice;
        UpdateNodeNotice?: UpdateNodeNotice;
        RemoveNodeNotice?: RemoveNodeNotice;
        CreateEdgeNotice?: CreateEdgeNotice;
        UpdateEdgeNotice?: UpdateEdgeNotice;
        RemoveEdgeNotice?: RemoveEdgeNotice;
        RemoveEdgeByHandleNotice?: RemoveEdgeByHandleNotice;
        UserMouseChangeNotice?: UserMouseChangeNotice;
        ExtDataConfigChangeNotice?: ExtDataConfigChangeNotice;
        NewChatMsgNotice?: NewChatMsgNotice;
    };
}

export namespace client {
    export interface WrongSessionNotice {
        name: string;
    };
    export interface ClearDrawMsgReadStateNotice {
        board_id: string;
        draw_id: string;
    };
    export interface AllNotice {
        WrongSessionNotice?: WrongSessionNotice;
        AdminLoginNotice?: {};
        ThemeChangeNotice?: {};
        ClearDrawMsgReadStateNotice?: ClearDrawMsgReadStateNotice;
    };
}

export type AllNotice = {
    BoardNotice?: board.AllNotice;
    ClientNotice?: client.AllNotice;
};
